//
//  ViewController.m
//  FaceDiscernmentDemo
//
//  Created by mac on 2019/2/20.
//  Copyright © 2019年 mac. All rights reserved.
//

#import "ViewController.h"
#import "FaceScanViewController.h"
#import "FaceCompareViewController.h"
#import "AuthenticationViewController.h"


@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIButton *btn = [[UIButton alloc]initWithFrame:CGRectMake(50, 200,BOUNDS.size.width-100, 40)];
    btn.backgroundColor = [UIColor yellowColor];
    [btn setTitle:@"开始人脸识别" forState:UIControlStateNormal];
    [btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(btnAcrion) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    
    
    UIButton *btnB = [[UIButton alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(btn.frame)+100, BOUNDS.size.width-100, 40)];
    btnB.backgroundColor = [UIColor yellowColor];
    [btnB setTitle:@"人脸对比" forState:UIControlStateNormal];
    [btnB setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [btnB addTarget:self action:@selector(btnBAcrion) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btnB];
    
    
    UIButton *btnC = [[UIButton alloc]initWithFrame:CGRectMake(50, CGRectGetMaxY(btnB.frame)+100, BOUNDS.size.width-100, 40)];
    btnC.backgroundColor = [UIColor yellowColor];
    [btnC setTitle:@"公安身份验证" forState:UIControlStateNormal];
    [btnC setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    [btnC addTarget:self action:@selector(btnCAcrion) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btnC];
    // Do any additional setup after loading the view, typically from a nib.
}

//开始识别
- (void)btnAcrion{
    FaceScanViewController *faceScan = [[FaceScanViewController alloc]init];
    UINavigationController *navigation = [[UINavigationController alloc]initWithRootViewController:faceScan];
    navigation.navigationBarHidden = true;
    [self presentViewController:navigation animated:YES completion:nil];
}

//人脸对比
- (void)btnBAcrion{
    FaceCompareViewController *faceCompare = [[FaceCompareViewController alloc]init];
    UINavigationController *navigation = [[UINavigationController alloc]initWithRootViewController:faceCompare];
    navigation.navigationBarHidden = true;
    [self presentViewController:navigation animated:YES completion:nil];
}

//身份验证
- (void)btnCAcrion{
    AuthenticationViewController *Authentication = [[AuthenticationViewController alloc]init];
    UINavigationController *navigation = [[UINavigationController alloc]initWithRootViewController:Authentication];
    navigation.navigationBarHidden = true;
    [self presentViewController:navigation animated:YES completion:nil];
}


@end
